﻿package com.findMoneyGame.pages.achievement {
	import flash.display.MovieClip;
	
	import flash.events.MouseEvent;
	import flash.events.Event;

	import com.findMoneyGame.models.Achievement;
	
	public class AchievedNotification extends MovieClip {
		public static var OK_BUTTON_CLICKED = "okButtonClicked";
		
		public function AchievedNotification(name : String, reward : int) {
			quest.text = name;
			rewardLabel.text = reward.toString();
			okButton.addEventListener(MouseEvent.CLICK, okButtonClicked);
		}
		private function okButtonClicked(e : Event) {
			okButton.removeEventListener(MouseEvent.CLICK, okButtonClicked);
			dispatchEvent(new Event(OK_BUTTON_CLICKED));
		}
	}
	
}
